package com.winenine999.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CFranchiseeMapper;
import com.winenine999.generator.dao.FranchiseeMapper;
import com.winenine999.jdbc.dao.FranchiseeDao;
import com.winenine999.model.Franchisee;
import com.winenine999.model.Page;
import com.winenine999.model.Syrole;
import com.winenine999.service.IFranchiseeService;
@Service
public class FranchiseeService implements IFranchiseeService {
	@Autowired
	private FranchiseeMapper franchiseeMapper;
	@Autowired
	private CFranchiseeMapper cFranchiseeMapper;
	@Autowired
	private FranchiseeDao franchiseeDao;
	@Override
	public Franchisee selectByPrimaryKey(Integer id) {		
		System.out.println("--------franchiseeMapper:"+franchiseeMapper);
		Franchisee franchisee=franchiseeMapper.selectByPrimaryKey(id);
		System.out.println("FranchiseeService-------franchisee:"+franchisee);
		return franchisee;
	}
	/**
	 * 根据id删franchisee
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return franchiseeMapper.deleteByPrimaryKey(id);
	}
	@Override
	public int insert(Franchisee franchisee) {
		
		return franchiseeMapper.insert(franchisee);
	}
	/**
	 * 选择字段添加franchisee
	 */
	@Override
	public int insertSelective(Franchisee franchisee) {
		
		return franchiseeMapper.insertSelective(franchisee);
	}
	/**
	 * 选择字段修改franchisee
	 */
	@Override
	public int updateByPrimaryKeySelective(Franchisee franchisee) {
		
		return franchiseeMapper.updateByPrimaryKeySelective(franchisee);
	}
	@Override
	public int updateByPrimaryKey(Franchisee franchisee) {
		
		return franchiseeMapper.updateByPrimaryKey(franchisee);
	}
//------------------------------custom---------------------------------
	/**
	 * 供franchisee分页使用
	 */
	@Override
	public Page findPagefranchisees(Page page) {
		
		return franchiseeDao.findPagefranchisees(page);
	}
}
